with open('html.html', 'r') as file:
    content = file.read()

print(content)
output = '#ifndef HTMLPAGE_H \n#define HTMLPAGE_H \n#include <Arduino.h> \n'
output += 'String reload_html()\n {\nString html111 = \"'
for line in content.split('\n'):
    # 处理特殊字符（如双引号和反斜杠）
    # line = line.replace('\\', '\\\\')
    line = line.replace('"', '\\"')
    line = line.replace('=====', '"')
    output += line #+ '\n'  # 添加换行符
output += '\";'+ '\n'  # 添加换行符
output += '  return html111; \n}\n#endif // HTMLPAGE_H'

print(output)

with open('htmlPage.h', 'w') as file:
    file.write(output)
